package com.linovi.stringbuilder

object Test {
  def main(args: Array[String]): Unit = {

    var test1 = new StringBuilder
    var test2: scala.collection.mutable.StringBuilder = new scala.collection.mutable.StringBuilder()
    var test3 = ""
    
    var time1 = System.currentTimeMillis()
    for (i <- 1 to 100000) {
      test1.append("ezgi")
    }
    var time2 = System.currentTimeMillis()
    println("Executed in " + (time2 - time1) + " milliseconds.")

    var time3 = System.currentTimeMillis()
    for (i <- 1 to 100000) {
      test2.append("ezgi")
    }
    var time4 = System.currentTimeMillis()
    println("Executed in " + (time4 - time3) + " milliseconds with Scala's StringBuilder.")

    var time5 = System.currentTimeMillis()
    for(i <- 1 to 100000)
    {
      test3 += "ezgi"
    }
    var time6 = System.currentTimeMillis()
    println("Executed in " + (time6 - time5) + "  miliseconds with + operator.")

  }

}